<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>FLtext</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="FLtabs_end.html" title="FLtabs_end" />
    <link rel="next" href="FLupdate.html" title="FLupdate" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">FLtext</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="FLtabs_end.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="FLupdate.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="FLtext"></a>
      <div class="titlepage"></div>
      <a id="IndexFLtext" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">FLtext</span>
        </h2>
        <p>FLtext — 
      A FLTK widget opcode that creates a textbox.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp108356016"></a>
        <h2>Description</h2>
        <p>
      <span class="emphasis"><em>FLtext</em></span> allows the user to modify a parameter value by directly typing it into a text field.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp108399472"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">kout, ihandle <span class="command"><strong>FLtext</strong></span> "label", imin, imax, istep, itype, iwidth, \
      iheight, ix, iy</pre>
      </div>
      <div class="refsect1">
        <a id="idp108401792"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ihandle</em></span> -- a handle value (an integer number) that unequivocally references a corresponding widget. This is used by other opcodes that modify a widget's properties (see <a class="link" href="ControlFltkAppearance.html" title="Modifying FLTK Widget Appearance"><em class="citetitle">Modifying FLTK Widget Appearance</em></a>). It is automatically output by <span class="emphasis"><em>FLtext</em></span> and must not be set by the user label. (The user label is a double-quoted string containing some user-provided text placed near the widget.)
    </p>
        <p>
      <span class="emphasis"><em><span class="quote">“<span class="quote">label</span>”</span></em></span> -- a double-quoted string containing some user-provided text, placed near corresponding widget.
    </p>
        <p>
      <span class="emphasis"><em>imin</em></span> -- minimum value of output range.
    </p>
        <p>
      <span class="emphasis"><em>imax</em></span> -- maximum value of output range.
    </p>
        <p>
      <span class="emphasis"><em>istep</em></span> -- a floating-point number indicating the increment of valuator value corresponding to the mouse dragging. The <span class="emphasis"><em>istep</em></span> argument allows the user to arbitrarily slow mouse motion, enabling arbitrary precision.
    </p>
        <p>
      <span class="emphasis"><em>itype</em></span> -- an integer number denoting the appearance of the valuator.
    </p>
        <p>
      The <span class="emphasis"><em>itype</em></span> argument can be set to the following values:

      </p>
        <div class="itemizedlist">
          <ul class="itemizedlist" style="list-style-type: disc; ">
            <li class="listitem">
              <p>1 - normal behaviour</p>
            </li>
            <li class="listitem">
              <p>2 - dragging operation is suppressed, instead it will appear two arrow buttons. A mouse-click on one of these buttons can increase/decrease the output value.</p>
            </li>
            <li class="listitem">
              <p>3 - text editing is suppressed, only mouse dragging modifies the output value.</p>
            </li>
          </ul>
        </div>
        <p>
    </p>
        <p>
      <span class="emphasis"><em>iwidth</em></span> -- width of widget.
    </p>
        <p>
      <span class="emphasis"><em>iheight</em></span> -- height of widget.
    </p>
        <p>
      <span class="emphasis"><em>ix</em></span> -- horizontal position of upper left corner of the valuator, relative to the upper left corner of corresponding window (expressed in pixels).
    </p>
        <p>
      <span class="emphasis"><em>iy</em></span> -- vertical position of upper left corner of the valuator, relative to the upper
left corner of corresponding window (expressed in pixels).
    </p>
      </div>
      <div class="refsect1">
        <a id="idp108416880"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>kout</em></span> -- output value
    </p>
        <p>
      <span class="emphasis"><em>FLtext</em></span> allows the user to modify a parameter value by directly typing it into a text field:

      </p>
        <div class="mediaobject">
          <img src="images/fltext.png" alt="FLtext." />
          <div class="caption">
            <p>FLtext.</p>
          </div>
        </div>
        <p>

      Its value can also be modified by clicking on it and dragging the mouse horizontally. The <span class="emphasis"><em>istep</em></span> argument allows the user to arbitrarily set the response on mouse dragging.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp108423184"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the FLtext opcode. It uses the file <a class="ulink" href="examples/FLtext.csd" target="_top"><em class="citetitle">FLtext.csd</em></a>.

      </p>
        <div class="example">
          <a id="idp108425040"></a>
          <p class="title">
            <strong>Example 290. Example of the FLtext opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
<span class="comment">; Audio out   Audio in    No messages</span>
-odac           -iadc     -d     <span class="comment">;;;RT audio I/O</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o FLtext.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="comment">; A sine with oscillator with fltext box controlled</span>
<span class="comment">; frequency either click and drag or double click and</span>
<span class="comment">; type to change frequency value</span>
<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">kr</span> <span class="op">=</span> 441
<span class="ohdr">ksmps</span> <span class="op">=</span> 100
<span class="ohdr">nchnls</span> <span class="op">=</span> 1

<span class="opc">FLpanel</span> "Frequency Text Box", 270, 600, 50, 50
    <span class="comment">; Minimum value output by the text box</span>
    imin <span class="op">=</span> 200
    <span class="comment">; Maximum value output by the text box</span>
    imax <span class="op">=</span> 5000
    <span class="comment">; Step size</span>
    istep <span class="op">=</span> 1
    <span class="comment">; Text box graphic type</span>
    itype <span class="op">=</span> 1
    <span class="comment">; Width of the text box in pixels</span>
    iwidth <span class="op">=</span> 70
    <span class="comment">; Height of the text box in pixels</span>
    iheight <span class="op">=</span> 30
    <span class="comment">; Distance of the left edge of the text box </span>
    <span class="comment">; from the left edge of the panel</span>
    ix <span class="op">=</span> 100
    <span class="comment">; Distance of the top edge of the text box</span>
    <span class="comment">; from the top edge of the panel</span>
    iy <span class="op">=</span> 300

    gkfreq,ihandle <span class="opc">FLtext</span> "Enter the frequency", imin, imax, istep, itype, iwidth, iheight, ix, iy
<span class="comment">; End of panel contents</span>
<span class="opc">FLpanelEnd</span>
<span class="comment">; Run the widget thread!</span>
<span class="opc">FLrun</span>

<span class="oblock">instr</span> 1
    iamp <span class="op">=</span> 15000
    ifn <span class="op">=</span> 1
    asig <span class="opc">oscili</span> iamp, gkfreq, ifn
    <span class="opc">out</span> asig
<span class="oblock">endin</span>


<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="comment">; Function table that defines a single cycle</span>
<span class="comment">; of a sine wave.</span>
<span class="stamnt">f</span> 1 0 1024 10 1

<span class="comment">; Instrument 1 will play a note for 1 hour.</span>
<span class="stamnt">i</span> 1 0 3600
<span class="stamnt">e</span>


<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp108429328"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="FLcount.html" title="FLcount"><em class="citetitle">FLcount</em></a>,
      <a class="link" href="FLjoy.html" title="FLjoy"><em class="citetitle">FLjoy</em></a>,
      <a class="link" href="FLknob.html" title="FLknob"><em class="citetitle">FLknob</em></a>,
      <a class="link" href="FLroller.html" title="FLroller"><em class="citetitle">FLroller</em></a>,
      <a class="link" href="FLslider.html" title="FLslider"><em class="citetitle">FLslider</em></a>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp108435216"></a>
        <h2>Credits</h2>
        <p>Author: Gabriel Maldonado</p>
        <p>New in version 4.22</p>
        <p>Example written by Iain McCurdy, edited by Kevin Conder.</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="FLtabs_end.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="FLupdate.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">FLtabs_end </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> FLupdate</td>
        </tr>
      </table>
    </div>
  </body>
</html>
